package model

import messageID "broker/struct/common/message_id"

/**
 * @Description
 * @Author huan.wang
 * @Date 2021/4/24 10:56 下午
 **/

type ConnectMessage struct {
	BaseMessage
	UserNameFlag byte
	PassWordFlag byte
	WillRetain   byte
	WillQos      byte
	WillFlag     byte
	CleanSession byte

	KeepAlive uint32

	ClientID  string
	WillTopic string
	WillMsg   string
	UserName  string
	PassWord  string
}

func NewConnectMessage() *ConnectMessage {
	newMsg := &ConnectMessage{}
	newMsg.SetMsgId(messageID.Connect)
	return newMsg
}
